libxc: Fix checks on grant notify arguments
authorDaniel De Graaf <dgdegra@tycho.nsa.gov>
Thu, 1 Dec 2011 18:20:12 +0000 (18:20 +0000)
committerDaniel De Graaf <dgdegra@tycho.nsa.gov>
Thu, 1 Dec 2011 18:20:12 +0000 (18:20 +0000)
commitdc52d92824439f5259fd24d476ad7ba5e043dd4e
tree16b497db51de1198657453269e490b3d5d628642
parent06be13898b572bc4f5e219153b57cc209ad26aaf
libxc: Fix checks on grant notify arguments

The notify offset and event channels are both unsigned variables, so
testing for >= 0 will not correctly detect the use of -1 to indicate
the field is unused. Remove the useless comparison and replace with
correct range checks or comparisons to -1.

Reported-by: Anil Madhavapeddy <anil@recoil.org>
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxc/xc_linux_osdep.c